<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:s="http://sduept.security.el/func"
	template="/template/template_dialog.xhtml">
	<ui:define name="head">
		<title>#{request.getParameter('lineName')} 故障报告</title>
		<style>
.ui-widget {
	font-family: "Microsoft JhengHei";
	font-weight: bold;
	font-size: 1.15em;
}

.ui-commandlink {
	font-family: FontAwesome;
}

.ui-panel .ui-panel-content {
	border: 0;
	background: 0;
	padding: 0 !important;
}

.ui-panel .ui-panel-titlebar-icon {
	margin-top: 0;
}

.ui-datatable .ui-datatable-footer {
	text-align: right;
	padding: 4px 10px;
}

.ui-datatable .ui-datatable-header {
	text-align: left;
	/* border-top: 0px;
    border-left: 0px; */
}

.ui-datatable .ui-datatable-data {
	border-top: 0px;
	border-left: 0px;
}

.ui-md-6, .ui-md-12, .ui-g-6, .ui-g-12 {
	padding: 0px !important;
}

/* tr,tr td:first-child,tr th:first-child{
	border-left-width:0px !important;
} */
.box-tools i {
	cursor: pointer;
	color: #999;
	margin-right: 5px;
}

.mouseon {
	cursor: pointer;
}

.box-tools i:hover {
	color: #3FA7DC;
}

.btn {
	padding: 1px 6px;
}

td {
	padding: 9px;
}

.ui-fileupload-icon-only .ui-button-text {
	padding-bottom: .5em;
}
/**
* 分析详情里面的差动电流的title 居中
*/
.title-center .ui-datatable-header {
	text-align: center;
}
</style>
		<link href='/resources/plugins/layer/skin/layer.css' rel='stylesheet' />
	</ui:define>
	<ui:define name="content">
		<h:form id="form1">
			<p:remoteCommand name="checkEditPageColsed"
				actionListener="#{busBarFaultReportController.pushTiming}" />
			<p:hotkey bind="ctrl+s" update="form1:msgs"
				actionListener="#{busBarFaultReportController.saveReportMain}" />
			<p:growl id="msgs" showDetail="true" />
			<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
				<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
				<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
			</p:confirmDialog>
			<p:toolbar>
				<f:facet name="left">
					<p:commandButton value="返回" icon="ui-icon-triangle-1-w" update="form1:msgs"
						rendered="#{busBarFaultReportController.showBackButton}" onclick="back()" />
					<p:commandButton value="编辑变电站" icon="ui-icon-pencil" update="form1:msgs form1"
						disabled="#{busBarFaultReportController.stationEdit}"
						actionListener="#{busBarFaultReportController.editStation(busBarFaultReportController.stationDetail.id)}"
						onclick="editStationPushTiming()" />
					<p:commandButton value="保存" icon="ui-icon-disk" update="form1:msgs"
						disabled="#{!busBarFaultReportController.stationEdit}"
						actionListener="#{busBarFaultReportController.saveReportMain}" />
				</f:facet>
			</p:toolbar>
			<p:panelGrid id="pg" style="width:100%">
				<p:row>
					<p:column>
						<p:outputLabel value="填表单位：" />
					</p:column>
					<p:column>
						<h:outputText id="reportUnit" value="#{busBarFaultReportController.stationDetail.reportUnit}"
							style="width:99%;border:none" />
					</p:column>
					<p:column>
						<p:outputLabel value="填表人：" />
					</p:column>
					<p:column>
						<h:outputText id="reportPerson"
							value="#{busBarFaultReportController.stationDetail.reportPerson}"
							style="width:99%;border:none">
						</h:outputText>
						<p:commandButton style="float:right" disabled="#{!busBarFaultReportController.stationEdit}"
							update="reportPerson reportUnit" icon="ui-icon-trash"
							actionListener="#{busBarFaultReportController.resetreportPersonAndUnit()}">
						</p:commandButton>
						<p:commandButton style="float:right" disabled="#{!busBarFaultReportController.stationEdit}"
							update="reportPerson reportUnit" icon="ui-icon-person"
							actionListener="#{busBarFaultReportController.onUserDialogReturn}" />
						<p:remoteCommand name="onUserDialogReturn" update="form1:reportPerson form1:reportUnit"
							actionListener="#{busBarFaultReportController.onUserDialogReturn}" />
					</p:column>
					<p:column>
						<p:outputLabel value="审核人：" />
					</p:column>
					<p:column>
						<h:outputText id="auditor" value="#{busBarFaultReportController.stationDetail.reviewer}"
							style="width:99%;border:none" onclick="PF('personDialog').show()">
						</h:outputText>
						<p:commandButton style="float:right" update="auditor" icon="ui-icon-trash"
							disabled="#{!busBarFaultReportController.stationEdit}"
							actionListener="#{busBarFaultReportController.resetreportAuditor()}">
						</p:commandButton>
						<p:commandButton style="float:right" update="auditor" icon="ui-icon-person"
							disabled="#{!busBarFaultReportController.stationEdit}"
							actionListener="#{busBarFaultReportController.onAuditorDialogReturn}" />
						<p:remoteCommand name="onAuditorDialogReturn" update="form1:auditor"
							actionListener="#{busBarFaultReportController.onAuditorDialogReturn}" />
					</p:column>
					<p:column>
						<p:outputLabel value="上报日期：" />
					</p:column>
					<p:column>
						<p:calendar navigator="true" inputStyle="border:none"
							value="#{busBarFaultReportController.stationDetail.reportTime}" pattern="yyyy-MM-dd"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.reportTime}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:outputLabel value="厂站名称：" />
					</p:column>
					<p:column>
						<h:outputText value="#{busBarFaultReportController.stationDetail.stationName}" />
					</p:column>
					<p:column>
						<p:outputLabel value="故障设备：" />
					</p:column>
					<p:column>
						<h:outputText value="#{busBarFaultReportController.faultReportMain.faultRecord.equipment}" />
					</p:column>
					<p:column>
						<p:outputLabel value="故障时间：" />
					</p:column>
					<p:column style="text-align:left;">
						<h:outputText value="#{busBarFaultReportController.faultReportMain.faultRecord.faultTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column>
						<p:outputLabel value="故障类型：" />
					</p:column>
					<p:column>
						<h:outputText value="#{busBarFaultReportController.faultReportMain.faultRecord.faultType}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:outputLabel value="电压等级：" />
					</p:column>
					<p:column>
						<h:outputText value="#{busBarFaultReportController.faultReportMain.faultRecord.voltage}kV" />
					</p:column>
					<p:column>
						<p:outputLabel value="故障原因分类：" />
					</p:column>
					<p:column>
						<h:outputText value="#{busBarFaultReportController.faultReportMain.faultRecord.faultReson}" />
					</p:column>
					<p:column>
						<p:outputLabel value="故障原因：" />
					</p:column>
					<p:column>
						<h:outputText style="white-space:pre-wrap;display:block;"
							value="#{busBarFaultReportController.faultReportMain.faultRecord.remark}" escape="false" />
					</p:column>
					<p:column>
						<p:outputLabel value="智能分析：" />
					</p:column>
					<p:column>
						<h:outputText style="white-space:pre-wrap;display:block;"
							value="#{busBarFaultReportController.faultReportMain.faultRecord.thunderInfo}" escape="false" />
						<h:outputText style="white-space:pre-wrap;display:block;"
							value="#{busBarFaultReportController.faultReportMain.faultRecord.iceInfo}" escape="false" />
					</p:column>
				</p:row>
				<p:row>
					<p:column style="font-weight: bold" rowspan="2">录波情况：</p:column>
					<p:column rowspan="2">
						<p:selectOneMenu value="#{busBarFaultReportController.stationDetail.waveRecordCondition}"
							style="width:80%;" rendered="#{busBarFaultReportController.stationEdit}">
							<f:selectItem itemLabel="" itemValue="" />
							<f:selectItem itemLabel="完好" itemValue="完好" />
							<f:selectItem itemLabel="缺" itemValue="缺" />
							<f:selectItem itemLabel="无装置" itemValue="无装置" />
						</p:selectOneMenu>
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.waveRecordCondition}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column style="font-weight: bold;" rowspan="2">故障电流：</p:column>
					<p:column style="font-weight: bold;width:9%">二次值(A)：</p:column>
					<p:column colspan="2">
						<p:inputText value="#{busBarFaultReportController.stationDetail.secondElectricity}"
							style="width:99%;border:none" rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.secondElectricity}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column rowspan="2">
						<p:outputLabel value="故障持续时间(ms)：" />
					</p:column>
					<p:column rowspan="2" style="width:15%">
						<p:inputNumber inputStyle="width:99%;border:none"
							value="#{busBarFaultReportController.stationDetail.firstFaultMs}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.firstFaultMs}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column style="font-weight: bold;width:9%">一次值(kA)：</p:column>
					<p:column colspan="2">
						<p:inputText value="#{busBarFaultReportController.stationDetail.firstElectricity}"
							style="width:99%;border:none" rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.firstElectricity}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column style="font-weight: bold;">
						<font style="color: red">*</font>快速保护是否动作：</p:column>
					<p:column>
						<p:selectOneMenu value="#{busBarFaultReportController.stationDetail.rapidProtection}"
							style="width:80%;" rendered="#{busBarFaultReportController.stationEdit}">
							<f:selectItem itemLabel="" itemValue="" />
							<f:selectItem itemLabel="是" itemValue="是" />
							<f:selectItem itemLabel="否" itemValue="否" />
						</p:selectOneMenu>
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.rapidProtection}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column style="font-weight: bold;">
						<font style="color: red">*</font>快速保护应评价次数：</p:column>
					<p:column>
						<p:spinner min="0" value="#{busBarFaultReportController.stationDetail.rapidProtectionShould}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.rapidProtectionShould}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column style="font-weight: bold">
						<font style="color: red">*</font>实际快速动作次数：</p:column>
					<p:column>
						<p:spinner min="0" value="#{busBarFaultReportController.stationDetail.rapidActionReality}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.rapidActionReality}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column>
						<p:outputLabel value="初步分析结论：" />
					</p:column>
					<p:column style="width:15%">
						<p:autoComplete value="#{busBarFaultReportController.faultReportMain.conclusion}"
							completeMethod="#{cimUtilController.completeFaultAnalysisConclusion}" dropdown="true"
							rendered="#{busBarFaultReportController.stationEdit}">
						</p:autoComplete>
						<p:outputLabel value="#{busBarFaultReportController.faultReportMain.conclusion}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column style="font-weight: bold;">保护动作分析结论：</p:column>
					<p:column style="font-weight: bold;">正确次数(含总出口)：</p:column>
					<p:column>
						<p:spinner min="0"
							value="#{busBarFaultReportController.stationDetail.protectRightActionCount}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.protectRightActionCount}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column style="font-weight: bold;">误动次数：</p:column>
					<p:column colspan="2">
						<p:spinner min="0"
							value="#{busBarFaultReportController.stationDetail.protectUnwantedActionCount}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.protectUnwantedActionCount}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
					<p:column style="font-weight: bold;">拒动次数：</p:column>
					<p:column>
						<p:spinner min="0"
							value="#{busBarFaultReportController.stationDetail.protectRefuseActionCount}"
							rendered="#{busBarFaultReportController.stationEdit}" />
						<p:outputLabel value="#{busBarFaultReportController.stationDetail.protectRefuseActionCount}"
							rendered="#{!busBarFaultReportController.stationEdit}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column colspan="8" style="text-align:right">
						<p:commandButton id="svgBtn" icon="ui-icon-image" style="float:right;" value="保护动作图"
							type="button" />
					</p:column>
				</p:row>
			</p:panelGrid>
			<p:overlayPanel id="svgPanel" modal="true" for="svgBtn" hideEffect="fade" dynamic="false"
				style="width:80%;height:520px;">
				<p:panelGrid>
					<p:commandButton value="更新数据" icon="ui-icon-refresh"
						onclick="document.getElementById('svgIframe').src='protectActSvgGraphic.xhtml?faultId=#{busBarFaultReportController.faultReportMain.faultRecord.id}'" />
					<small>保存数据后有效 </small>
					<iframe id="svgIframe" width="100%" height="460" scrolling="no" frameborder="0"
						src="protectActSvgGraphic.xhtml?faultId=#{busBarFaultReportController.faultReportMain.faultRecord.id}"></iframe>
				</p:panelGrid>
			</p:overlayPanel>
			<p:toolbar style="margin-top:8px">
				<f:facet name="left">
					<p:commandButton value="添加元件" disabled="#{!busBarFaultReportController.stationEdit}"
						actionListener="#{busBarFaultReportController.addActionComponent()}" update="form1:fcdt"
						icon="ui-icon-document" />
					<p:commandButton value="删除" disabled="#{!busBarFaultReportController.stationEdit}"
						actionListener="#{busBarFaultReportController.deleteSelectComponentList()}"
						update="form1:fcdt" icon="ui-icon-trash">
						<p:confirm header="提示" message="确定删除选择的记录吗？" icon="ui-icon-alert" />
					</p:commandButton>
				</f:facet>
			</p:toolbar>
			<p:dataTable id="fcdt" widgetVar="dt" var="componts"
				selection="#{busBarFaultReportController.selectComponentList}"
				value="#{busBarFaultReportController.componentList}" rowKey="#{componts.id}" emptyMessage="无记录">
				<p:ajax event="rowSelect" listener="#{busBarFaultReportController.onActionComponentRowSelect}" />
				<f:facet name="header">
			     	 元件动作详情
			  </f:facet>
				<p:column selectionMode="multiple" style="width:55px;text-align:center" />
				<p:column headerText="保护名称">
					<p:autoComplete completeMethod="#{busBarFaultReportController.completeProtectName}"
						dropdown="true" inputStyle="width:99%" value="#{componts.protectName}"
						rendered="#{busBarFaultReportController.stationEdit}">
						<p:ajax event="itemSelect" update="fcdt"
							listener="#{busBarFaultReportController.handleProtectSelect}" />
					</p:autoComplete>
					<p:outputLabel value="#{componts.protectName}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="保护类型">
					<p:autoComplete completeMethod="#{cimUtilController.completeProtectType}" dropdown="true"
						inputStyle="width:99%" value="#{componts.protectType}" />
					<p:outputLabel value="#{componts.protectName}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="保护型号">
					<p:inputText style="width:99%;border:none;" value="#{componts.protectModel}" />
				</p:column>
				<p:column headerText="动作元件">
					<p:autoComplete scrollHeight="300" completeMethod="#{busBarFaultReportController.completeActionComponent(componts)}"
						dropdown="true" inputStyle="width:99%" value="#{componts.actionComponent}"
						rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.actionComponent}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="功能分类">
					<p:autoComplete completeMethod="#{cimUtilController.completeFunctionType}" dropdown="true"
						inputStyle="width:99%" value="#{componts.funClassification}"
						rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.funClassification}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="动作时间（毫秒）">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.actionTime}" />
					<p:outputLabel value="#{componts.funClassification}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="动作情况">
					<p:inputText style="width:99%;border:none;" value="#{componts.actionCondition}"
						rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.actionCondition}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="备注">
					<p:autoComplete completeMethod="#{busBarFaultReportController.completeActionComponentRemark}"
						dropdown="true" inputStyle="width:99%;" value="#{componts.remark}"
						rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.remark}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
			</p:dataTable>
			<p:toolbar style="margin-top:8px">
				<f:facet name="left">
					<p:commandButton value="添加主保护" disabled="#{!busBarFaultReportController.stationEdit}"
						onclick="openNeedDeviceDialog('zbhdz','#{busBarFaultReportController.faultReportMain.faultRecord.equipment_id}','#{busBarFaultReportController.stationDetail.stationId}');"
						icon="ui-icon-document" />
					<p:remoteCommand name="onDeviceDialogReturn"
						actionListener="#{busBarFaultReportController.onDeviceDialogReturn}" />
					<p:commandButton value="添加断路器保护" disabled="#{!busBarFaultReportController.stationEdit}"
						onclick="openNeedDeviceDialog('dlqbhdzxx','#{busBarFaultReportController.faultReportMain.faultRecord.equipment_id}','#{busBarFaultReportController.stationDetail.stationId}');"
						icon="ui-icon-document" />
					<p:commandButton value="添加断路器" disabled="#{!busBarFaultReportController.stationEdit}"
						onclick="openNeedDeviceDialog('dlqdzxx','#{busBarFaultReportController.faultReportMain.faultRecord.equipment_id}','#{busBarFaultReportController.stationDetail.stationId}');"
						icon="ui-icon-document" />
					<p:commandButton value="删除" update="form1:fdt form1:fbdt"
						disabled="#{!busBarFaultReportController.stationEdit}"
						actionListener="#{busBarFaultReportController.deleteSelectActionProcess()}"
						icon="ui-icon-trash">
						<p:confirm header="提示" message="确定删除选择的记录吗？" icon="ui-icon-alert" />
					</p:commandButton>
					<p:commandButton icon="ui-icon-help" value="帮助" oncomplete="alertProtectTip()" />
				</f:facet>
			</p:toolbar>
			<p:dataTable id="fdt" widgetVar="fdt"
				selection="#{busBarFaultReportController.selectedProtectDeviceActionProcessList}" var="componts"
				value="#{busBarFaultReportController.protectDeviceActionProcessList}" rowKey="#{componts.id}"
				emptyMessage="无记录">
				<f:facet name="header">
				     	 保护动作详情
				</f:facet>
				<p:column selectionMode="multiple" style="width:55px;text-align:center" />
				<p:column headerText="设备类型" width="8%" groupRow="true">
					<p:outputLabel value="#{componts.devType}" />
				</p:column>
				<p:column headerText="设备名称" width="18%">
					<p:outputLabel value="#{componts.devName}" />
				</p:column>
				<p:column headerText="设备型号">
					<p:outputLabel value="#{componts.devModel}" />
				</p:column>
				<p:column headerText="跳A(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripA}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripA}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="跳B(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripB}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripB}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="跳C(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripC}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripC}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
			</p:dataTable>
			<p:dataTable id="fbdt" widgetVar="fbdt"
				selection="#{busBarFaultReportController.selectedBreakerDeviceActionProcessList}" var="componts"
				value="#{busBarFaultReportController.breakerDeviceActionProcessList}" rowKey="#{componts.id}"
				emptyMessage="无记录">
				<f:facet name="header">
				     	 断路器动作详情
				</f:facet>
				<p:column selectionMode="multiple" style="width:55px;text-align:center" />
				<p:column headerText="设备类型" width="8%" groupRow="true">
					<p:outputLabel value="#{componts.devType}" />
				</p:column>
				<p:column headerText="设备名称" width="18%">
					<p:outputLabel value="#{componts.devName}" />
				</p:column>
				<p:column headerText="设备型号">
					<p:outputLabel value="#{componts.devModel}" />
				</p:column>
				<p:column headerText="断弧(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripA}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripA}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="断弧(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripB}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripB}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
				<p:column headerText="断弧(毫秒)">
					<p:inputNumber inputStyle="color:green;width:99%;border:none;text-align:center"
						value="#{componts.fTripC}" rendered="#{busBarFaultReportController.stationEdit}" />
					<p:outputLabel value="#{componts.fTripC}"
						rendered="#{!busBarFaultReportController.stationEdit}" />
				</p:column>
			</p:dataTable>
			<p:toolbar id="fUploadWaveFileToolbar">
				<f:facet name="left">
					<p:commandButton value="上传录波文件" icon="ui-icon-arrowreturnthick-1-n"
						update="form1:msgs dialogForm:uploadWaveFileDialog"
						disabled="#{!busBarFaultReportController.stationEdit}"
						rendered="#{s:hasPermission(session,'bhyx_gzda_lbwj_sc')}"
						oncomplete="PF('uploadWaveFileDialog').show()" />
					<p:commandButton value="下载录波文件" icon="ui-icon-arrowthick-1-s" ajax="false"
						rendered="#{s:hasPermission(session,'bhyx_gzda_lbwj_xz')}"
						actionListener="#{waveFileController.prepareDownloadFile(busBarFaultReportController.stationDetail.stationId)}">
						<p:fileDownload value="#{waveFileController.downloadFile}" />
					</p:commandButton>
				</f:facet>
			</p:toolbar>
			<p:dataTable id="fWaveFileTable" var="item"
				value="#{waveFileController.getWaveFileByStationId(busBarFaultReportController.stationDetail.stationId)}"
				rowKey="#{item.id}" emptyMessage="无记录" rowIndexVar="ite">
				<f:facet name="header">
				     录波文件
				</f:facet>
				<p:column width="2" headerText="序号 " style="text-align:center">
					<h:outputText value="#{ite+1}" />
				</p:column>
				<p:column width="10" headerText="时间">
					<h:outputText value="#{item.triggerSecond.substring(0,19)}">
					</h:outputText>
				</p:column>
				<p:column width="10" headerText="变电站名称">
					<h:outputText value="#{item.stationName}" />
				</p:column>
				<p:column width="10" headerText="装置">
					<h:outputText value="#{item.equipment}" />
				</p:column>
				<p:column width="50" headerText="录波文件">
					<h:outputText value="#{item.path}" />
				</p:column>
				<p:column width="5" headerText="分析状态">
					<h:outputText value="#{item.status}" />
				</p:column>
				<p:column width="5" headerText="文件来源">
					<h:outputText rendered="#{item.dataSource == 0}" value="系统获取" />
					<h:outputText rendered="#{item.dataSource == 1}" value="人工上传" />
				</p:column>
				<p:column width="10" headerText="查看" style="text-align:center">
					<p:commandButton icon="ui-icon-search"
						oncomplete="openWaveDlg('#{item.id}', '#{busBarFaultReportController.stationDetail.stationId}','#{item.stationName}','#{busBarFaultReportController.fr.equipment_id}');" />
				</p:column>
			</p:dataTable>
			<p:toolbar id="fUploadFileToolbar" style="margin-top:8px">
				<f:facet name="left">
					<p:commandButton title="上传" disabled="#{!busBarFaultReportController.stationEdit}"
						update="form1:msgs dialogForm:uploadAttachmentDialog" icon="ui-icon-arrowreturnthick-1-n"
						value="上传" oncomplete="PF('uploadAttachmentDialog').show()"
						rendered="#{s:hasPermission(session,'bhyx_gzda_gzfj_sc')}">
					</p:commandButton>
					<p:commandButton value="下载" ajax="false"
						rendered="#{s:hasPermission(session,'bhyx_gzda_gzfj_xz')}"
						actionListener="#{busBarFaultReportController.downloadAttachment()}"
						icon="ui-icon-arrowthick-1-s" update="form1:msgs">
						<p:fileDownload value="#{busBarFaultReportController.file}" />
					</p:commandButton>
					<p:commandButton value="删除" disabled="#{!busBarFaultReportController.stationEdit}"
						rendered="#{s:hasPermission(session,'bhyx_gzda_gzfj_sc1')}"
						actionListener="#{busBarFaultReportController.deleteAttachment()}"
						update="fat fUploadFileToolbar" icon="ui-icon-trash">
						<p:confirm header="提示" message="确定删除选择的记录吗？" icon="ui-icon-alert" />
					</p:commandButton>
				</f:facet>
			</p:toolbar>
			<p:dataTable id="fat" var="componts" widgetVar="fat" rowIndexVar="ite"
				selection="#{busBarFaultReportController.selectedAttachments1}"
				value="#{busBarFaultReportController.attachments1}" rowKey="#{componts.id}" emptyMessage="无记录">
				<f:facet name="header">
				    保护动作报告附件
				</f:facet>
				<p:column selectionMode="multiple" width="10" style="text-align:center" />
				<p:column headerText="序号" width="10">
					<p:outputLabel value="#{ite+1}" />
				</p:column>
				<p:column headerText="名称" width="90">
					<p:outputLabel value="#{componts.name}" />
				</p:column>
				<p:column headerText="缩略图" width="18%">
					<p:graphicImage alt="加载失败" rendered="#{busBarFaultReportController.isPicture(componts)}"
						height="100"
						value="#{request.contextPath}/getServerImage?fullPath=#{busBarFaultReportController.getVirtualPath(componts.path)}" />
				</p:column>
				<p:column width="10" style="text-align: center">
					<p:commandButton icon="ui-icon-search"
						rendered="#{busBarFaultReportController.isPicture(componts)}"
						oncomplete="openImagePage('#{busBarFaultReportController.getVirtualPath(componts.path)}');" />
				</p:column>
			</p:dataTable>
		</h:form>
		<h:form id="dialogForm">
			<p:dialog widgetVar="uploadAttachmentDialog" modal="true" id="uploadAttachmentDialog" width="600"
				header="保护动作报告附件上传">
				<p:fileUpload multiple="true" label="选择" uploadLabel="上传" cancelLabel="取消"
					fileUploadListener="#{busBarFaultReportController.handleFileUpload}" mode="advanced"
					update="form1:msgs @this " />
				<p:commandButton icon="ui-icon-disk" oncomplete="PF('uploadAttachmentDialog').hide()"
					style="float:right;" update="form1:fat" value="关闭并刷新">
				</p:commandButton>
			</p:dialog>
			<!-- 上传录波文件 -->
			<p:dialog widgetVar="uploadWaveFileDialog" position="top" id="uploadWaveFileDialog"
				header="录波文件上传" style="margin-top:50px;" modal="true" width="900" height="620">
				<p:outputPanel id="waveFilePanel">
					<table style="width: 100%">
						<tr>
							<td><small><span class="fa fa-warning" style="color: #f39c12" />
									上传录波文件时，应选择与之对应的录波设备，并<b>同时上传.cfg和.dat文件</b>。右侧可选择全部录波设备。 <br /> <span
									class="fa fa-warning" style="color: #f39c12" /> 如果不是本次故障的录波文件，系统将会系统生成错误的故障数据。 </small></td>
							<td><p:selectBooleanButton style="float:right"
									value="#{waveFileController.showRelatedEquipment}" onLabel="全部录波设备" offLabel="相关录波设备">
									<p:ajax update="waveFilePanel" listener="#{waveFileController.changeWaveEquipmentList}" />
								</p:selectBooleanButton></td>
						</tr>
					</table>
					<p:dataTable var="we" id="waveEquipmentTable"
						value="#{waveFileController.getCurrentWaveEquipmentList(busBarFaultReportController.stationDetail.stationId)}"
						selection="#{waveFileController.selectedWaveEquipment}" selectionMode="single"
						rowKey="#{we.id}" emptyMessage="无记录" sortBy="#{we.subName}">
						<p:ajax event="rowSelect"
							update="dialogForm:uploadCom dialogForm:uploadMsg dialogForm:waveFilePanel"
							listener="#{waveFileController.onWaveEquipmentRowSelect}" />
						<p:ajax event="rowUnselect"
							update="dialogForm:uploadCom dialogForm:uploadMsg dialogForm:waveFilePanel"
							listener="#{waveFileController.onWaveEquipmentRowUnSelect}" />
						<p:column groupRow="true" headerText="变电站">
							<h:outputText value="#{we.subName}" />
						</p:column>
						<p:column headerText="类型">
							<h:outputText value="#{waveFileController.getWaveEquipmentType(we)}" />
						</p:column>
						<p:column headerText="录波器">
							<h:outputText value="#{we.name}" />
						</p:column>
					</p:dataTable>
					<p:separator />
					<p:fileUpload multiple="true" id="uploadCom"
						disabled="#{waveFileController.selectedWaveEquipment==null}"
						invalidFileMessage="文件扩展名必须是dat或者cfg"
						allowTypes="/(\.|\/)(((c|C)(f|F)(g|G))|((d|D)(a|A)(t|T)))$/" label="选择" uploadLabel="上传"
						cancelLabel="取消" fileUploadListener="#{waveFileController.handleWaveFileUpload}" fileLimit="2"
						fileLimitMessage="文件个数必须是2个" mode="advanced"
						update="form1:msgs  form1:fWaveFileTable uploadMsg waveFilePanel " />
					<p:outputLabel id="uploadMsg" style="color:red;font-size:16px;" escape="false"
						value="#{waveFileController.uploadMsg}" />
					<br />
					<p:commandLink id="reBtn" value="继续上传" style="font-size:16px;color:#0080FF;margin-left:5px;"
						rendered="#{waveFileController.btnAvailable()}"
						actionListener="#{waveFileController.reUploadFile}"
						update="form1:msgs  form1:fWaveFileTable uploadMsg waveFilePanel" />
					<p:commandLink id="cancleBtn" value="取消上传"
						style="font-size:16px;color:#0080FF;margin-left:30px;"
						rendered="#{waveFileController.btnAvailable()}"
						actionListener="#{waveFileController.cancleUpload}"
						update="form1:msgs uploadMsg waveFilePanel" />
					<br />
				</p:outputPanel>
			</p:dialog>
		</h:form>
		<h:inputHidden id="faultEditTiming" value="#{busBarFaultReportController.timingInteval}"></h:inputHidden>
		<script>
			function back(){
				if(parent &amp;&amp; parent.backFromFaultReportEdit){
					parent.backFromFaultReportEdit();
				}else{
					window.history.back();
				}
			}
			var userDialogIndex;
			var auditorDialogIndex;
			var needDeviceDialogIndex;
			function openUserChooseDialog(){
				//打开页面
				userDialogIndex = layer.open({
					  type: 2,
					  maxmin :false,
					  area: ['420px', '662px'],
					  fixed: false, //不固定
					  title:'人员选择器',
					  maxmin: true,
					  content: '/ui/common/org_selector_user_single_layer.xhtml'
					});
			}
			function openAuditorDialog(){
				//打开页面
				auditorDialogIndex = layer.open({
					  type: 2,
					  maxmin :false,
					  area: ['420px', '662px'],
					  fixed: false, //不固定
					  title:'人员选择器',
					  maxmin: true,
					  content: '/ui/common/org_selector_user_single_layer.xhtml'
					});
			}
			function dialogReturn(index,data){
				var params = [];
				data = eval("("+data+")");
				if(index == userDialogIndex){
					params.push({name:'className',value:data.className},{name:'userJson',value:data.data});
					onUserDialogReturn(params);
				}else if(index == auditorDialogIndex){
					params.push({name:'className',value:data.className},{name:'userJson',value:data.data});
					onAuditorDialogReturn(params);
				}else if(index == needDeviceDialogIndex){
					params.push({name:'className',value:data.className},{name:'data',value:data.data},{name:'type',value:data.type});
					onDeviceDialogReturn(params);
				}
			}
			//打开设备选择器页面
			function openNeedDeviceDialog(type,deviceId,stationId){
				var params = "stationId="+ stationId+"&amp;protectionType="+type+"&amp;deviceId="+deviceId;
				needDeviceDialogIndex = layer.open({
					  type: 2,
					  maxmin :false,
					  area: ['610px', '462px'],
					  fixed: false, //不固定
					  title:'设备选择器',
					  maxmin: true,
					  content: '/ui/common/equipment_selector_faultReport_protectiont_layer.xhtml?'+params
					});
			}
			//打开设备维护页面。此页面的入口在设备选择器页面
			function openProtectAccountDialog(){
				layer.close(needDeviceDialogIndex);
				layer.open({
					  type: 2,
					  maxmin :false,
					  area: ['1250px', '750px'],
					  fixed: false, //不固定
					  title:'设备维护',
					  maxmin: true,
					  content: '/ui/dataview/devicefault/protectAccountDialog.xhtml',
					});
			}
			function alertProtectTip(){
				layer.alert(
						"1、如果该故障报告没有记录保护动作，断路器熄弧信息，系统会默认生成该故障设备相关的所有保护，断路器信息，但动作时间为0。"
						+"&lt;br/&gt;2、保存故障报告时，系统会过滤掉保护动作时间为0及断路器熄弧时间为0的信息。"
						+"&lt;br/&gt;3、如果该故障报告有保护动作，断路器熄弧信息，则只显示动作时间（或熄弧时间）大于0的信息。"
						,
						{
							closeBtn: 0,
							title:false,
							area:['660px']
						});
			}
			function openImagePage(path){
				var link = document.createElement('a');
				link.target = "_blank";
				link.href = '/ui/common/imagePage.xhtml?fullPath='+path;
			    document.body.appendChild(link);
				link.click();
				document.body.removeChild(link);
			}
			function openWaveDlg(fileId, stationId, stationName,lineId) {
				var src = "/ui/waveh5/index.html?fileId=" + fileId
						+ "&amp;stationId=" + stationId + "&amp;lineId="
						+ lineId + "&amp;stationName="
						+ encodeURIComponent(stationName);
				layer.open({
					  type: 2,
					  maxmin :false,
					  area: ['90%', '90%'],
					  fixed: false, //不固定
					  title:'波形查看',
					  maxmin: true,
					  content: src,
					});
			}
			var timingInteval = $('#faultEditTiming').val();
			function editStationPushTiming(){
				if(timingInteval){
					self.setInterval("checkEditPageColsed()",timingInteval);
				}else{
					self.setInterval("checkEditPageColsed()",5000);
				}
				}
		</script>
	</ui:define>
</ui:composition>